package wang.com;

/**
 * @ProjectName: untitled
 * @Titile: Student
 * @Author: 王亦凡1
 * @Description: TODO
 */
public class Student {
    // 成员变量
    private String id;      // 学号
    private String name;   // 姓名
    private int age;       // 年龄
    private String address; // 住址

    // 构造方法
    // 1. 无参构造
    public Student() {
    }

    // 2. 带四个参数的构造
    public Student(String id, String name, int age, String address) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.address = address;
    }

    // 成员方法 - getter和setter
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    // 可选：重写toString方法便于打印学生信息
    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", address='" + address + '\'' +
                '}';
    }
}